package done.easy_501_600;

import org.junit.Test;

import static com.study.util.LogUtil.info;
import static java.lang.Math.abs;

/**
 * 504. Base 7 七进制数
 * <p>
 * 给定一个整数，将其转化为7进制，并以字符串形式输出。
 * <p>
 * 示例 1:
 * 输入: 100
 * 输出: "202"
 * 示例 2:
 * 输入: -7
 * 输出: "-10"
 *
 * @author 大硕
 * 2019-04-11 10:30 PM
 **/
@SuppressWarnings("all")
public class Base7 {

    public String convertToBase7(int num) {
        // 190411 first
        return null;
    }

    @Test
    public void test() {
        info(convertToBase7(0));
        info(convertToBase7(-100));
    }
}









































/*
public String convertToBase7(int num) {
    if (num == 0)
        return "0";

    String flag = "";
    if (num < 0) {
        flag = "-";
        num = num * -1;
    }

    String ret = "";
    while (num != 0) {
        ret = num % 7 + ret;
        num = num / 7;
    }
    return flag + ret;
}
*/
